package com.futures.questionbank.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.bumptech.glide.request.RequestOptions;
import com.futures.questionbank.R;
import com.futures.questionbank.db.table.zixun;
import com.futures.questionbank.ui.home.InfoActivity;

import java.util.List;

public class SectionAdpter2 extends BaseRecycleAdapter<zixun> {
    private List<zixun> dataList;
    private Context mContext;
    private BaseViewHolder.onItemCommonClickListener commonClickListener;



    public SectionAdpter2(Context context, List<zixun> dataList, BaseViewHolder.onItemCommonClickListener commonClickListener) {
        super(context, dataList, R.layout.itme_zixun_list);
        this.dataList = dataList;
        this.commonClickListener = commonClickListener;
        mContext = context;
    }

    @Override
    public void bindData(BaseViewHolder holder, zixun data) {
        holder.setText(R.id.tv_name, data.getTitle());
        holder.setText(R.id.tv_title, data.getTime());
        RequestOptions options = new RequestOptions().placeholder(R.mipmap.no);
       // Glide.with(mContext).load(data.getIcon())
              //  .apply(options)
              //  .into((ImageView) holder.getView(R.id.iv_doctor));
        holder.getView(R.id.rl).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                 intent.putExtra("desc", data.getDesc());
                 intent.setClass(mContext, InfoActivity.class);
                 mContext.startActivity(intent);
            }
        });
    }
}
